class ListPaginationModel {
  late int total;
  late int perPage;
  late int currentPage;
  late int lastPage;
  bool get hasMore => lastPage > currentPage;
  bool get enableOnload => lastPage > 1;
  bool isReady = false;

  ListPaginationModel({
    this.total = 0,
    this.perPage = 0,
    this.currentPage = 0,
    this.lastPage = 0,
  });

  ListPaginationModel.fromJson(Map<String, dynamic> json) {
    total = json['total'];
    perPage = json['per_page'];
    currentPage = json['current_page'];
    lastPage = json['last_page'];
    isReady = true;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = {};
    data['total'] = total;
    data['per_page'] = perPage;
    data['current_page'] = currentPage;
    data['last_page'] = lastPage;
    data['has_more'] = hasMore;
    return data;
  }
}
